package com.egide;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class CollectionPagerAdapter extends FragmentPagerAdapter {
	private final int NUM_OF_PAGES = 5;
	
	public CollectionPagerAdapter(FragmentManager fm) {
		super(fm);
	}
	
	@Override
	public Fragment getItem(int i) {		
	    Fragment fragment = new ObjectFragment();
	    Bundle args = new Bundle();
	    // Our object is just an integer :-P
	    args.putInt(ObjectFragment.ARG_OBJECT, i + 1);
	    fragment.setArguments(args);
	    return fragment;
	}
	
	@Override
	public int getCount() {
	    return NUM_OF_PAGES;
	}
	
	@Override
	public CharSequence getPageTitle(int position) {
	    return "OBJECT " + (position + 1);
	}
}
